using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;


namespace XFGameFramework.PanelExtension
{

    [CustomEditor(typeof(GamepadPanelExtension))] 
    public class GamepadPanelExtensionInspector : Editor
    {

        private GamepadPanelExtension gamepad = null;

        private GUIStyle style;



        private void OnEnable()
        {
            gamepad = target as GamepadPanelExtension;
        }

        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            if (EditorApplication.isPlaying) 
            {
                if (style == null) { 
                    style = new GUIStyle(GUI.skin.label);
                    style.richText = true; 
                }
                

                EditorGUILayout.LabelField("状态:", gamepad.Active ? "<b><color=green>活跃</color></b>" : "<b><color=grey>非活跃</color></b>", style);

                // 注：只有最上层的界面为活跃状态，能够通过手柄或键盘控制 
                EditorGUILayout.LabelField("", "<size=10><color=grey>注：只有最上层的界面为活跃状态，能够通过手柄或键盘控制</color></size>", style);
            }

        }

    }

}

